package com.yedean.mall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yedean.mall.entity.UmsRole;
import com.yedean.mall.mapper.UmsRoleMapper;
import com.yedean.mall.service.IUmsRoleService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 后台用户角色表 服务实现类
 * </p>
 *
 * @author yedean
 * @since 2022-08-03
 */
@Service
public class UmsRoleServiceImpl extends ServiceImpl<UmsRoleMapper, UmsRole> implements IUmsRoleService {

    @Override
    public IPage<UmsRole> list(String keyword, Integer pageSize, Integer pageNum) {

        IPage<UmsRole> page = new Page<>(pageNum, pageSize);

        QueryWrapper<UmsRole> wrapper = new QueryWrapper<>();
        wrapper.like("name",keyword);

        return baseMapper.selectPage(page,wrapper);
    }
}
